package com.msameer.gwttutor.client;

import com.google.gwt.activity.shared.AbstractActivity;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.place.shared.Place;
import com.google.gwt.user.client.ui.AcceptsOneWidget;

public class CustomersActivity extends AbstractActivity implements CustomersView.Presenter {

    // Used to obtain views, eventBus, placeController
    // Alternatively, could be injected via GIN
    private ClientFactory clientFactory;
    // Name that will be appended to "Hello,"
    //private String name;

    public CustomersActivity(CustomersPlace place, ClientFactory clientFactory) {
        //this.name = place.getName();
        this.clientFactory = clientFactory;
    }
    
	@Override
	public void start(AcceptsOneWidget panel, EventBus eventBus) {
        CustomersView customersView = clientFactory.getCustomersView();
        //customersView.setName(name);
        customersView.setPresenter(this);
        panel.setWidget(customersView.asWidget());
	}

	@Override
	public void goTo(Place place) {
        clientFactory.getPlaceController().goTo(place);		
	}

}
